home *** CD-ROM | disk | FTP | other *** search
- Path: news.umbc.edu!not-for-mail
- From: schlein@umbc.edu (Jonas J. Schlein)
- Newsgroups: comp.lang.c
- Subject: Re: strings
- Date: 29 Jan 1996 15:31:43 -0500
- Organization: University of Maryland Baltimore County
- Message-ID: <4ejarf$gma@umbc9.umbc.edu>
- References: <4eg9qj$1ut4@sp115.ocs.lsu.edu>
- NNTP-Posting-Host: umbc9.umbc.edu
- NNTP-Posting-User: schlein
-
- Pradeep Nayar <eenaya@unix1.sncc.lsu.edu> wrote:
- |> I saw this piece of code in a book somewhere.
- |>
- |> ----
- |> char *str ;
- |>
- |> str = "hello world"[10] ;
- |>
- |> _________
- |>
- |> what does the second line do?
-
- It tries to assign a single character to a char * variable. In other words
- it's the same as:
-
- str = 'd';
-
- which is both illegal and meaningless. I'd recommend not using this book.
- --
- "If it wasn't for C, we would be using BASI, PASAL, and OBOL."
-
- Jonas J. Schlein (schlein@gl.umbc.edu)
-